<% if @email_config || @body.present? %>
  <% body = (@body.presence || @email_config.value['body']).to_s %>
  <%= render 'custom_content', content: ReplaceEmailVariables.call(body, submitter: @submitter) %>
  <% if !body.include?(ReplaceEmailVariables::SUBMITTER_LINK) && !body.include?(ReplaceEmailVariables::SUBMITTER_ID) && !body.include?(ReplaceEmailVariables::SUBMISSION_LINK) && !body.include?(ReplaceEmailVariables::TEMPLATE_ID) && !@submitter.submission.source.in?(%w[api embed]) %>
    <p><%= link_to nil, submit_form_url(slug: @submitter.slug, t: SubmissionEvents.build_tracking_param(@submitter, 'click_email')) %></p>
  <% end %>
<% else %>
  <p>Hi there,</p>
  <p>You have been invited to submit the "<%= @submitter.submission.template.name %>" form.</p>
  <p><%= link_to 'Submit Form', submit_form_url(slug: @submitter.slug, t: SubmissionEvents.build_tracking_param(@submitter, 'click_email')) %></p>
  <p>Please contact us by replying to this email if you didn't request this.</p>
  <p>
    Thanks,<br><%= @current_account.name %>
  </p>
<% end %>
